/**Created by the LayaAirIDE*/
module view{
	export class GameStart extends ui.GameStartUI{
		constructor(){
			super();

			this._init();
		}

		_init(): void {
			this.soundBtn.on("click", this, this.soundBtnClick, [0])
			this.updateSoundBtn(!SoundPlayer.Instance.mute)
		}

		soundBtnClick(): void {
			this.updateSoundBtn(!this.soundBtn.selected)
			SoundPlayer.Instance.setMute(!this.soundBtn.selected)
		}

		updateSoundBtn(selected: boolean): void {
			if (selected) {
				this.soundBtn.skin = "images/button_sound_off.png"
			}else {
				this.soundBtn.skin = "images/button_sound_on.png"
			}

			this.soundBtn.selected = selected
		}
	}
}